﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="TemplatedDialog.aspx.cs" Inherits="SCS.Web.UI.WebControls.Dialogs.Test.TemplatedDialog" %>
<%@ Register assembly="SCS.Web.UI.WebControls.Dialogs" namespace="SCS.Web.UI.WebControls.Dialogs" tagprefix="cc1" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="act" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Templated Dialog</h2>

    <p>
        The Templated Dialog inherits all the functionality of the Dialog Control and adds a template for adding custom markup to the dialog body. 
        The template allows you to quickly create any dialog to suit your needs with the dialog layout and behavior being provided for you.
    </p>

    <p>
        For a live example of a dialog created with the Templated Dialog click <asp:LinkButton ID="launchDialogButton" runat="server" Text="here" />. 
        This example shows the Templated Dialog which has been customized by adding a couple fields and a submit button to its DialogContent template. 
        The full markup for creating this dialog is shown below.
    </p>
    
    <div class="code-box">
    <pre>
    &lt;cc1:TemplatedDialog ID=&quot;Dialog1&quot; runat=&quot;server&quot;        
        CssClass=&quot;dialog&quot;
        BackgroundCssClass=&quot;modalBackground&quot;         
        Title=&quot;Dialog Test&quot;        
        TargetControlId=&quot;launchDialogButton&quot;         
        ShowTitlebarCloseButton=&quot;true&quot;
        ShowCloseButton=&quot;false&quot; 
        ShowOkButton=&quot;false&quot;&gt;
        <span class="highlight">
        &lt;DialogContent&gt;
        &lt;table&gt;
            &lt;tr&gt;                    
                &lt;td colspan=&quot;2&quot;&gt;&lt;asp:Label ID=&quot;dialogMessage&quot; runat=&quot;server&quot; /&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;th&gt;Field 1&lt;/th&gt;
                &lt;td&gt;&lt;asp:TextBox ID=&quot;field1Entry&quot; runat=&quot;server&quot; /&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;th&gt;Field 2&lt;/th&gt;
                &lt;td&gt;&lt;asp:TextBox ID=&quot;field2Entry&quot; runat=&quot;server&quot; /&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;                    
                &lt;td&gt;&lt;/td&gt;
                &lt;td&gt;&lt;asp:Button ID=&quot;submitCommand&quot; runat=&quot;server&quot; Text=&quot;Save&quot; 
                    OnClick=&quot;submitCommand_Click&quot; /&gt;&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;
        &lt;/DialogContent&gt;
        </span>
    &lt;/cc1:TemplatedDialog&gt;
    </pre>
    <div class="caption">Templated Dialog Example Markup</div>
    </div>

<cc1:TemplatedDialog ID="Dialog1" runat="server"        
    CssClass="dialog"
    BackgroundCssClass="modalBackground"         
    Title="Templated Dialog Example"        
    TargetControlId="launchDialogButton"         
    ShowTitlebarCloseButton="true"
    ShowCloseButton="false" 
    ShowOkButton="false">
        
        <DialogContent>
            <table>
                <tr>                    
                    <td colspan="2"><asp:Label ID="dialogMessage" runat="server" /></td>
                </tr>
                <tr>
                    <th>Field 1</th>
                    <td><asp:TextBox ID="field1Entry" runat="server" /></td>
                </tr>
                <tr>
                    <th>Field 2</th>
                    <td><asp:TextBox ID="field2Entry" runat="server" /></td>
                </tr>
                <tr> 
                    <td></td>                   
                    <td><asp:Button ID="submitCommand" runat="server" Text="Save" OnClick="submitCommand_Click" /></td>
                </tr>
            </table>
        </DialogContent>
    </cc1:TemplatedDialog>
</asp:Content>
